package org.example.feign;

import org.example.entity.Order;
import org.example.entity.OrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

@FeignClient(value = "order")
public interface OrderFeign {

    @PostMapping("/order/save")
    public void save(@RequestBody Order order);

    @GetMapping("/order/findAllByUid/{index}/{limit}/{uid}")
    public OrderVO findAllByUid(@PathVariable("index")int index, @PathVariable("limit")int limit, @PathVariable("uid")long uid);

    @GetMapping("/order/findAll/{index}/{limit}")
    public OrderVO findAllByState(@PathVariable("index")int index, @PathVariable("limit")int limit);

    @PutMapping("/order/updateState/{id}")
    public void updateState(@PathVariable("id") long id);

    @GetMapping("/order/pay/{tradeNo}/{subject}/{totalAmount}")
    String pay(@PathVariable("tradeNo") String tradeNo,@PathVariable("subject")  String subject,@PathVariable("totalAmount") String totalAmount);

    @GetMapping("/alipay/pay/{tradeNo}/{subject}/{totalAmount}")
    String alipay(@PathVariable("tradeNo") String tradeNo,@PathVariable("subject")  String subject,@PathVariable("totalAmount") String totalAmount);


}
